package cn.nawang.ebeim.api.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import cn.nawang.ebeim.api.utils.DateUtils;

@Entity
@Table(name = "tb_cusumer")
public class Customer {

  @Id
  private String id;
  
  @Column(name = "name")
  private String name;
  
  @Column(name = "space_size")
  private String space;
  
  @Column(name="space_capacity")
  private String spaceCapacity;
  
  @Column(name="max_copys")
  private int maxCopys;
  
  @Column(name="create_time")
  private Long createTime;
  
  @Column(name="customer_key")
  private String customerKey;
  
  @Column(name="sales_pacakge_id")
  private String salesPacakgeId;
  
  @Transient
  private String createTimeStr;

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getSpace() {
    return space;
  }

  public void setSpace(String space) {
    this.space = space;
  }
  
  public String getSpaceCapacity() {
    return spaceCapacity;
  }

  public void setSpaceCapacity(String spaceCapacity) {
    this.spaceCapacity = spaceCapacity;
  }

  public int getMaxCopys() {
    return maxCopys;
  }

  public void setMaxCopys(int maxCopys) {
    this.maxCopys = maxCopys;
  }

  public Long getCreateTime() {
    return createTime;
  }

  public void setCreateTime(Long createTime) {
    this.createTime = createTime;
  }

  public String getCreateTimeStr() {
    if(this.getCreateTime()==null){
      return "";
    }
    return DateUtils.longTime2String(this.getCreateTime());
  }

  public void setCreateTimeStr(String createTimeStr) {
    this.createTimeStr = createTimeStr;
  }
  
  public String getCustomerKey() {
    return customerKey;
  }

  public void setCustomerKey(String customerKey) {
    this.customerKey = customerKey;
  }

  public String getSalesPacakgeId() {
    return salesPacakgeId;
  }

  public void setSalesPacakgeId(String salesPacakgeId) {
    this.salesPacakgeId = salesPacakgeId;
  }

  @Override
  public String toString() {
    return "Customer [id=" + id + ", name=" + name + ", space=" + space + ", spaceCapacity="
        + spaceCapacity + ", maxCopys=" + maxCopys + ", createTime=" + createTime + ", customerKey="
        + customerKey + ", salesPacakgeId=" + salesPacakgeId + ", createTimeStr=" + createTimeStr
        + "]";
  }
  
  
}
